﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace ProjetoFinal
{
    class Fruit
    {
        private static Texture2D banana, acai, graviola, mango, jackfruit;
        public  Rectangle rect;
        public enum type
        { banana = 3, acai = 5, graviola = 10, mango = 15, jackfruit = 20 }
        public type FruitType;
      
        /*banana 3, açaí 5, graviola 10, manga 15 e jaca 20*/

        public static ContentManager c;
        public Fruit(Vector2 position, type type)
        {
            if (banana == null)
            {
                banana = c.Load<Texture2D>("banana");
                acai = c.Load<Texture2D>("açai");
                graviola = c.Load<Texture2D>("graviola");
                mango = c.Load<Texture2D>("mango");
                jackfruit = c.Load<Texture2D>("jackfruit");
            }

            this.rect = new Rectangle((int)position.X, (int)position.Y, banana.Width, banana.Height);

            this.FruitType = type;
        }
        

        public virtual void Update()
        {
       
        }

        public virtual void Draw(SpriteBatch spriteBatch)
        {
            switch (FruitType)
            {
                case type.banana:
                    spriteBatch.Draw(banana, rect, Color.White);
                    break;
                case type.acai:
                    spriteBatch.Draw(acai, rect, Color.White);
                    break;
                case type.graviola:
                    spriteBatch.Draw(graviola, rect, Color.White);
                    break;
                case type.mango:
                    spriteBatch.Draw(mango, rect, Color.White);
                    break;
                case type.jackfruit:
                    spriteBatch.Draw(jackfruit, rect, Color.White);
                    break;
            }
            
        }
    }
}
